import { useState } from 'react'

function Dog(){
    // a = false
    let [isBarking,setIsBarking] = useState(false)
    let [isRunning,setIsRunning] = useState(false)
    const handleClick = () => {
        // DOM 编程已经一去不复返勒
        setIsBarking(true)
        setIsRunning(true)
        // a = true;
    }
    return(
        // 动态 多个状态
        <div onClick={handleClick}>
            <div>Dog</div>
            <p>{isBarking && '汪汪汪'}</p>
            <p>{isRunning && 'runrunrun'}</p>
        </div>
    )
}

export default Dog